package cn.itsource.org.mapper;

import cn.itsource.org.domain.Department;
import cn.itsource.org.query.DepartmentQuery;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 部门表的持久层
 *
 * spring生成代理mapper实现
 *
 * mybatis第一天学的
 *
 * UserMapper userMapper = sqlSession.getMapper(UserMapper.class)
 * sout userMapper.getClass   proxy$14534
 *
 * Mapper映射器
 */
public interface DepartmentMapper extends Mapper<Department> {
    //基础的crud方法由继承获得

    /**
     * 分页查询
     */
    List<Department> selectPage(DepartmentQuery query);

    /**
     * 批量删除
     */
    void batchDelete(@Param("ids") Long[] ids);

    /**
     * 查询上级部门
     */
    List<Department> findParentDepts();
}
